-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: use a canvas demo for $effect
#10745
Conversation
|
I tried both demos and they work. Far more understandable and more fun too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this reads better, have some suggestions though.
Reviewing the
$effect
docs in light of #10740, I think we can make a few improvements. Submitting them as separate PRs so they can be discussed independently.The examples we use provide framing for how constructs are supposed to be used. I think we've been making a mistake, therefore, by using
console.log
in$effect
examples when$inspect
is a better tool for the job.The current example is rather confusing in other ways:
count
contains{double}
(mea culpa)double
changes because it's read inside asetTimeout
, but it will re-run whendouble
changes because it re-runs whencount
changes, anddouble
changes whencount
changes